<style>
    #login-button{
        background: #286090!important;
        color: white!important;
        border: 1px solid #286090!important;
        border-radius: 3px;
    }
</style>
<script type="text/javascript" charset="utf-8" src="/ueditor/ueditor.config.js"></script>
<script type="text/javascript" charset="utf-8" src="/ueditor/ueditor.all.min.js"> </script>
<script type="text/javascript" charset="utf-8" src="/ueditor/lang/zh-cn/zh-cn.js"></script>
<script type="text/javascript" src="/My97DatePicker/WdatePicker.js"></script>

<div class="span10">
    <div style="margin-bottom: 20px;">
        <a href="/index/index">首页</a><span >&gt;</span><span>banner管理</span><span >&gt;</span><span>添加/修改</span>
    </div>

    <form name="form" method="post" action="<?php echo baseUrl."/content/banner/add"?>" enctype="multipart/form-data">
        <table>
            <tr>
                <td>name*:</td>
                <td>
                    <input  type="text" name="name" value="<?php echo isset($data)? $data['name']:''?>" />
                </td>
            </tr>

            <tr>
                <td>所属端:</td>
                <td>
                    <select name="type">
                        <option value ="">请选择</option>
                        <option value ="1" <?php echo isset($data)&& $data['type']==1 ?  'selected':''?>>PC</option>
                        <option value ="2" <?php echo isset($data)&& $data['type']==2 ?  'selected':''?>>WAP</option>
                        <option value ="3" <?php echo isset($data)&& $data['type']==3 ?  'selected':''?>>APP</option>
                    </select>
                </td>
            </tr>
            <tr>
                <td width="80px">位置 *:</td>
                <td>
                    <select name="cate">
                        <option value ="">请添加banner图位置</option>
                        <option value ="1" <?php echo isset($data)&& $data['cate']==1 ?  'selected':''?>>首页顶部</option>
                        <option value ="2" <?php echo isset($data)&& $data['cate']==2 ?  'selected':''?>>首页中部</option>
                        <option value ="3" <?php echo isset($data)&& $data['cate']==3 ?  'selected':''?>>首页底部</option>
                        <option value ="4" <?php echo isset($data)&& $data['cate']==4 ?  'selected':''?>>资讯专题顶部</option>
                    </select>
                </td>
            <?php if(isset($data)) {
                $str = '<tr>';
                $str .= '<td>原图片:</td>';
                $str .= '<td>';
                $pic = $data['pic'];
                $str .= "<input name='pic' type='text' value='" . $pic . "'></td></tr>";
                echo $str;
            } ?>

            <tr>
                <td width="120px">上传、修改图片:</td>
                <td>
                    <input id="file" type="file" name="pic" >
                </td>
            </tr>
            <tr>
                <td>外链地址*:</td>
                <td>
                    <input  type="text" name="url" value="<?php echo isset($data)? $data['url']:''?>" />
                </td>
            </tr>
<!--            <tr>-->
<!--                <td>点击量:</td>-->
<!--                <td>-->
<!--                    <input  type="text" name="viewCount" value="--><?php //echo isset($data)? $data['viewCount']:''?><!--" />-->
<!--                </td>-->
<!--            </tr>-->
            <tr>
                <td>排序:</td>
                <td>
                    <input  type="text" name="sort" value="<?php echo isset($data)? $data['sort']:''?>" />
                </td>
            </tr>
            <tr>
                <td>中部banner时间:</td>
                <td>
                    <input class="input-small Wdate" onclick="WdatePicker({dateFmt:'yyyy-MM-dd'})" type="text" style="width: 150px;" name="bannerTime" value="<?php echo isset($data['bannerTime']) ? date('Y-m-d', $data['bannerTime']) : '' ?>"/>
                </td>

            </tr>
            <tr>
                <td>底部banner剩余名额:</td>
                <td>
                    <input  type="text" name="quota" value="<?php echo isset($data)? $data['quota']:''?>" />
                </td>
            </tr>
            <tr>
                <td>跳转类型:</td>
                <td>
                    <select name="jumpType">
                        <option value ="">请选择</option>
                        <option value ="1" <?php echo isset($data)&& $data['jumpType']==1 ?  'selected':''?>>资讯</option>
                        <option value ="2" <?php echo isset($data)&& $data['jumpType']==2 ?  'selected':''?>>活动</option>
                        <option value ="3" <?php echo isset($data)&& $data['jumpType']==3 ?  'selected':''?>>外链</option>
                    </select>
                </td>
            </tr>
            <tr>
                <td>内容id:</td>
                <td>
                    <input  type="text" name="contentId" value="<?php echo isset($data)? $data['contentId']:''?>" />
                </td>
            </tr>
            <tr>
                <td>app内容id:</td>
                <td>
                    <input  type="text" name="appContentId" value="<?php echo isset($data)? $data['appContentId']:''?>" />
                </td>
            </tr>
            <tr>
                <td colspan="2" align="right">
                    <input type="hidden" name='id' value="<?php echo isset($data)? $data['id']:''?>"/>
                    <button type="submit" id="login-button">添加/修改</button></td>
            </tr>
            <input type="hidden" name="_csrf" value="<?=Yii::$app->request->getCsrfToken()?>" />
        </table>
    </form>

</div>